<template>
  <div>
<!--    <template v-if="!status || status < 4 ">-->
<!--      <Piece :handleType="handleType" :id="id"></Piece>-->
<!--    </template>-->
    <template v-if="handleType === 'add' ">
      <Piece></Piece>
    </template>
    <template v-else-if="handleType === 'view' ">
      <template v-if="!status || status <= 3 ">
        <Piece :handleType="handleType" :id="id"></Piece>
      </template>
      <template v-else-if="status <= 6 ">
        <Worker :handleType="handleType" :id="id"></Worker>
      </template>
      <template v-else-if="status <= 10 ">
        <Worker :handleType="handleType" :id="id" :isOdd="true"></Worker>
      </template>
      <template v-else-if="status == 11 ">
        <Worker :handleType="handleType" :id="id" :isOdd="true" :isEnd="true"></Worker>
      </template>
      <template v-else>
        <el-empty description="抱歉，状态不可查看"></el-empty>
      </template>
    </template>
    <template v-else-if="handleType === 'edit' ">
      <template v-if="!status || status < 3 ">
        <Piece :handleType="handleType" :id="id"></Piece>
      </template>
      <template v-else-if="status < 6 ">
        <Worker :handleType="handleType" :id="id"></Worker>
      </template>
      <template v-else-if="status < 9 ">
        <Worker :handleType="handleType" :id="id" :isOdd="true"></Worker>
      </template>
      <template v-else-if="status == 10 ">
        <Worker :handleType="handleType" :id="id" :isOdd="true" :isEnd="true"></Worker>
      </template>
      <template v-else>
        <el-empty description="抱歉，状态不可编辑"></el-empty>
      </template>
    </template>
    <template v-else>
      <el-empty description="抱歉，请求错误"></el-empty>
    </template>
  </div>
</template>

<script>
  import { viewTimeShift , viewUserData , addQualityPredict} from "@/api/job/qualityPredict/qualityPredict";
  import {getToken} from "@/utils/auth";
  import Piece from "../piece";
  import Worker from "../worker";
  export default {
    name: "employeeAdd",
    components:{
      Piece,
      Worker
    },
    created() {
      const { status, handleType,id } = this.$route.query;
      // console.log(status,id);
      this.handleType = handleType;
      this.id = id;
      this.status = status;

    },
    data() {
      return {
        handleType: '',  //操作类型 ' view edit
        id: null,   //订单id
        status: null,   //订单id
      };
    },

    methods: {
    },


  };
</script>

